
import { defineStore } from 'pinia'

export const useUserStore = defineStore({
  id: 'user',
  state: () => {
    return {
        number:120,//来消息信息
        userCenterShow:false,
        info:{
            userName:'jerry xiao',
            name:'热心小肖',
            avatar:'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
            introduction:'这是小肖',
            roles:[]
        }
    }
  },
  getters:{

  },
  actions:{
    addUserCenterShow(show:Boolean) {
        this.userCenterShow = show;
    },
    addUserSetting(event:Boolean) {
        this.info = event;
    },
    userOutin() {
        this.info ={
            userName:'',
            name:'',
            avatar:'',
            introduction:'',
            roles:[]
        };
    },
  },
  persist: {
    storage: localStorage
  }
})